<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title><?=SITE_NAME; ?></title>
	<meta name="author" content="Jeff Denton : The Teaching Research Institute : dentonj@wou.edu">
	<link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" />
	<link rel="stylesheet" type="text/css" href="ext/resources/css/accordion.css" />
	<link rel="stylesheet" type="text/css" href="ext/resources/css/filetree.css" />
	<link rel="stylesheet" type="text/css" href="ext/resources/css/uploadform.css" />
	
	<link rel="STYLESHEET" href="css/<?=$stylesheet; ?>">
	<link rel="STYLESHEET" href="css/effects<?=$browser; ?>.css">
	
	<!--[if IE]>
		<link rel="stylesheet" type="text/css" href="css/stylesIE.css" />
	<![endif]-->
	<!-- JavaScript Files -->
		<!-- EXT Library Stuff -->
		<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
	    <script type="text/javascript" src="ext/ext-all.js"></script>
	    
	    <!-- Ext Extension Library Stuff  -->
	    <script type="text/javascript" src="ext/Ext.ux.InfoPanel.js"></script>
		<script type="text/javascript" src="ext/Ext.ux.Accordion.js"></script>
		<script type="text/javascript" src="ext/Ext.ux.UploadForm.js"></script>
    	<script type="text/javascript" src="ext/Ext.ux.FileTreePanel.js"></script>
    	
    	<? if ($toolbox == 1) { ?>   	
    	<script type="text/javascript" src="js/toolbox.js"></script>
    	<? } ?>
			    
	    <!-- Protaculous Stuff (Do we need this) -->
	    <SCRIPT src="js/protaculous/prototype.js" language="JavaScript" type=text/javascript></SCRIPT>
		<SCRIPT src="js/protaculous/scriptaculous.js?load=builder,effects" language="JavaScript" type="text/javascript"></SCRIPT>
	    
	    <!-- My JavaScript Files -->
		<SCRIPT src="js/jsCommon.js" language="JavaScript" type=text/javascript></SCRIPT>	    
	    <? if (!empty($jsFile)) { ?>
		<SCRIPT src="js/<?=$jsFile; ?>" language="JavaScript" type=text/javascript></SCRIPT>
		<? } ?>	
		
	<!-- End JavaScript Files -->
	
	<script language="JavaScript">
		function jScriptInit() {
			initToolTips();		
			<? if ( ($file == 'index.php') && ($_SESSION[logged] != 1) ) { ?>
				document.getElementById('userid').focus();
			<? } ?>
		}
		<? if ($sajax == 1) { ?>	
		<? sajax_show_javascript(); ?>
		<? } ?>
	
		Example = function(){
			var layout;
	        return {
	            init : function(){
	               layout = new Ext.BorderLayout(document.body, {
	                    north: {
	                        split:false,
	                        initialSize: 78,
	                        titlebar: false
	                    },
	                    west: {
	                        split:true,
	                        initialSize: 220,
	                        minSize: 175,
	                        maxSize: 400,
	                        titlebar: true,
	                        collapsible: true,
                            animate: true,
                            autoScroll:false,
		                    useShim:true
	                    },
	                    <? if ($toolbox == 1) { ?>
	                    east: {
	                        split:       true,
	                        initialSize: 280,
	                        minSize:     175,
	                        maxSize:     400,
	                        titlebar:    true,
	                        collapsible: true,
                            animate:     true,
                            collapsed:   true
	                    },
	                    <? } ?>
	                    south: {
	                        split:true,
	                        initialSize: 100,
	                        minSize: 100,
	                        maxSize: 200,
	                        titlebar: true,
	                        collapsible: true,
                            animate: true,
                            collapsed:true
	                    },
	                    center: {
	                        titlebar: true,
	                        autoScroll:true,
                            closeOnTab: true,
                            tabPosition: 'top'
                        }
	                }); // end layout

                    layout.beginUpdate();
                    	// Header Panel
		                	layout.add('north', new Ext.ContentPanel('north', 'North'));
		                
		                // Footer Panel
							layout.add('south', new Ext.ContentPanel('south', {title: 'Some other content', closable: true}));
		                
						// Main Menu Panel
							<? if ($_SESSION[logged] == 1) { ?>
							layout.add('west', panelMainMenu = new Ext.ContentPanel('west', {title: 'Main Menu'}));
							<? } ?>
							        
						// Toolbox Panel
							<? if ($toolbox == 1) { ?>
							layout.add('east', panelTools = new Ext.ContentPanel('east', {title: 'Toolbox', closable: false}));
							
							// Set up event handlers for when tools panel is opened/closed
							var panelTools = layout.getRegion('east');
							
							panelTools.on('resize', function() {
								alert('Tools Panel');							
							});	
							<? } ?>						        
							                
						// Center Panel(s)
							<? 
							// Add center panels based on site area
							$noPanels = count($siteAreaArray[SITE_AREA])-1;
							/*
							if ( (SITE_AREA == 'contacts') && ($_SESSION[userLevel] == 1) ) {
								// Remove Edit my Contacts tab for super users
								// because they need the ability to edit anyone.
								$noPanels = $noPanels-1;
							}
							*/
							for($a=0;$a<=$noPanels;$a++) {
								$panelTitle = $siteAreaArray[SITE_AREA][$a];
							?>
								layout.add('center', panel<?=$a; ?> = new Ext.ContentPanel('content<?=$a; ?>', {title: '<?=$panelTitle; ?>', closable: false}));
							
								// Set up our event handlers for when content panel tabs are clicked
								panel<?=$a; ?>.on('activate', function(){
									if (self.content<?=$a; ?>LoadFunction) {
								    	content<?=$a; ?>LoadFunction();
								    }	
								   });
							
							<? } ?>
		                
						// Always show content0 panel
							layout.getRegion('center').showPanel('content0');	                
		                
	                layout.endUpdate();
	           }, // end init : function
	           
	           toggleContent : function(panelID,doAction,itemID){
	           		layout.getRegion('center').showPanel(panelID);	
	           		if (doAction == 'edit') {
	           			editInit(itemID);
	           		}									
	           }                 
	     }; // end return
	       
		}(); // end Example = function
		Ext.EventManager.onDocumentReady(Example.init, Example, true);
	</script>
	<? if ($richtext == 1) { ?>
		<script language="javascript" type="text/javascript" src="<?=$pre; ?>js/tinyeditor/tiny_mce.js"></script>
	<? } ?>
</head>
<body onLoad="jScriptInit();" <?=$bodyStuff; ?>>
<div id="toolTipLayer" class="toolTipLayer"></div>
<div id="container">
	<!-- Main Menu -->
	<? if ($_SESSION[logged] == 1) { ?>
	<div id="west" class="x-layout-inactive-content">
	    <? include('includes/menuMain.php'); ?>
	</div>
	<? } ?>
	<!-- End Main Menu :: Header Area -->
	<div id="north" style="border: none; padding: 0px; margin: 0px;">
    	<div id="header1">
    		<?
    		if (!empty($_SESSION[logged])) {
				echo '<span class="fullName">Welcome, '.$_SESSION[name].'</span>';
			}
    		?>
			<div align="right">
				<? if (!empty($_SESSION[logged])) { ?>
		        <font color="white">Logged in as: <b><?=$_SESSION['userid']; ?></b>&nbsp;&nbsp;</font><br>
				<font color="white">User Level: <b><? echo $userLevelArray[$_SESSION['userLevel']]; ?></b>&nbsp;&nbsp;</font><br><br>
				<a href="index.php?logout=1"><img src="images/logout.gif" border="0" title="Logout"></a>&nbsp;&nbsp;
				<a href="index.php">HOME</a>
				<? } ?>
			</div>
		</div>
  	</div>
  	<div id="east" class="x-layout-inactive-content">
	<? if ($toolbox == 1) { include("includes/toolbox.php"); } ?>
	</div>
  		